class Projects < ActiveRecord::Migration
  def self.up
    create_table :projects do |t|
      t.column "name", :string
      t.column "parent_id", :integer
      t.column "action_items_count", :integer, :default => 0
      t.column "created_at", :datetime
    end
    
    create_table :action_items do |t|
      t.column "project_id", :integer, :null => false
      t.column "due", :datetime
      t.column "name", :string
      t.column "status", :string, :default => "Not Open"
      t.column "blurb", :string
    end
    
    create_table :notes do |t|
      t.column "action_item_id", :integer, :null => false
      t.column "user_id", :integer, :null => false
      t.column "created_at", :datetime
      t.column "header", :string
      t.column "text", :text
    end
  end

  def self.down
    drop_table :projects
    drop_table :action_items
    drop_table :notes
  end
end
